package cn.dinxian.activiti.demo2.config;

import com.google.common.collect.Lists;
import cn.dinxian.entity.ActTaskDTO;
import cn.dinxian.entity.BaseDTO;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @author dingxian
 * @Title:
 * @param:
 * @return:
 * @Date 2023/3/3 0:28
 * @Description:
 */
@Configuration
public class secuir implements UserDetailsService {
  @Override
  public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    List<GrantedAuthority> grantedAuthorities = Lists.newArrayList();
    GrantedAuthority grantedAuthority = new SimpleGrantedAuthority("ROLE_ACTIVITI_USER");
    grantedAuthorities.add(grantedAuthority);
    return new User(username, "123", grantedAuthorities);
  }


}
